<?php

namespace App\Http\Controllers\Backend;

use App\Http\Controllers\Controller;
use App\Models\FileTransaction;

class FileController extends Controller
{

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $user = \Auth::user();
        if (!$user->hasPermissionTo('文件管理')) {
            return view('error.error');
        }
        $files = FileTransaction::with(['author'])->where('mime_type', 'video/mp4')->paginate(15);
        return view('media.index', ['files' => $files]);
    }
}
